{template admin/head}
<script type="text/javascript">
var ajaxparam = {
		'url' : '{SITE_URL}/ajax/admin.php'
};
function deladmin(id,status,str)
{
	if(id)
	{
		
		layer.confirm('你确定执行'+str+'操作吗？', {
		  time: 0 //不自动关闭
		  ,btn: ['很确定', '点错了']
		  ,yes: function(index){
		    layer.close(index);
		    
		    
		    var url = ajaxparam.url + '?m=cpUserStatus';
			var data = {
					'id' : id,
					'status':status,
					'str':str,
			};
			var callback = function(data){
				if(data.sign == 1)
				{
					layer.alert(data.msg,function(){
						window.location = window.location;
					});
				}
				else
				{
					if(data.msg)
					{
						layer.msg(data.msg);
					}
					else
					{
						layer.msg('操作失败');
					}
				}
			};
			makeAjax('post',url,data,callback);
		    
		    
		    
		    
		    
		    
		    
		    
		  }
		});
		
		
		
		
	}else{
		alert('参数错误');
	}
}
</script>
<body>
<div class="wrapper">
	<div class="crumbs"><a href="{SITE_URL}admin.php?a={$action}">{$fTitle}</a> &gt; <span>{$sTitle}</span> </div>
	
	<div class="container_tit clearfix mb20 ft14">
	
	<form action="{SITE_URL}admin.php?a={$action}" method="get">
		<input type="hidden" name="a" value="{$action}" />
        
        
        <div class="btn_box fl">
        	<span>注册时间段</span>
        	<input type="text" class="w200 text" style="width:220px;" class="text" format='time' name='start' id="start" value="{$parm['start']}" placeholder="请输入日期">
			<span>至</span>
			<input type="text" class="mr15 w200 text" style="width:220px;" class="text" format='time' name='end' id="end" value="{$parm['end']}" placeholder="请输入日期">
       </div>
       
       <div class="choose fl mr15">
        	<span>用户状态</span>
            <select class="select w150" name="status">
            	<option value="">请选择</option>
            	<option {if $parm['status']=='1'}selected{/if} value="1">正常</option>
            	<option {if $parm['status']=='2'}selected{/if} value="2">禁用</option>
            </select>
        </div>
        
        <div class="choose fl mr15" style="padding-top:10px">
            <select class="select w150" name="type">
            	<option value="-1">查询条件</option>
            	<!--{if is_array($typearr)}-->
            	<!--{loop $typearr $key $one}-->
            	<!--{if $key==$parm['type']}-->
            	<option value="{$key}" selected>{$one}</option>
            	<!--{else}-->
            	<option value="{$key}">{$one}</option>
            	<!--{/if}-->
            	<!--{/loop}-->
            	<!--{/if}-->
            </select>
            <input type="text" id="keyword" name="keyword" class="mr15 w200 text" value="{$parm['keyword']}">
        </div>
       
        <div class="btn_box fl" style="padding-top:10px">
        	<input type="submit" name="submit" class="btnblue mr15" value="搜索">
        </div>
    </form>
    </div>
	
	<!-- list -->
	<table class="table">
		<thead>
			<tr class="bg_h_1">
				<th width="">姓名</th>
				<th width="">手机号</th>
				<th width="">投资总金额</th>
				<th width="">返利总金额</th>
				<th width="">提现总金额</th>
				<th width="">注册时间</th>
				<th width="">最后登录时间</th>
				<th width="">登录次数</th>
				<th width="">状态</th>
            	<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
		<!--{loop $list $key $one}-->
			<tr>
				<td style="text-align: center;">{$one['nickname']}</td>
				<td style="text-align: center;">{$one['loginname']}</td>
				
				<td style="text-align: center;">{php echo $one['data']['touzi']}</td>
				<td style="text-align: center;">
					<a class="btn_look" href="{SITE_URL}admin.php?a=userM&m=userfanli&uid={$one[id]}"  title="查看返利信息">
						{if !empty($one['data']['fanli'])}
							{php echo $one['data']['fanli']}
						{else}
							0
						{/if}
					</a>
				</td>
				<td style="text-align: center;">
					<a class="btn_look" href="{SITE_URL}admin.php?a=userM&m=usertixian&uid={$one[id]}"  title="查看提现信息">
						{if !empty($one['data2']['tixian'])}
							{php echo $one['data2']['tixian']}
						{else}
							0
						{/if}
					</a>
				</td>
				<td style="text-align: center;">{php echo time_formart($one['regtime'],2)}</td>
				<td style="text-align: center;">{php echo time_formart($one['lasttime'],2)}</td>
				<td style="text-align: center;">{$one['lastnums']}</td>
				<td style="text-align: center;">
					{if $one[status] == 1}
						正常
					{elseif $one[status] == 2}
						禁用
					{/if}
				</td>
				<td style="text-align: center;">
					{if $one[status] == 1}
						<a href="javascript:;" onclick="deladmin('{$one[id]}','2','禁用');" class="btn_set"  title="禁用">禁用</a>
					{elseif $one[status] == 2}
						<a href="javascript:;" onclick="deladmin('{$one[id]}','1','启用');" class="btn_set"  title="禁用">启用</a>
					{/if}
					<a class="btn_look" href="{SITE_URL}admin.php?a={$action}&m=detail&id={$one[id]}"  title="查看详情">查看详情</a>
				</td>
			</tr>
		<!--{/loop}-->
		</tbody>
	</table>
</div>

<!--{php pagenav($pageurl,$page,$pagetotal);}-->
{template admin/foot}